package com.xingcheng.discord.midjourney;

/**
 * @author xingchen
 * @version 1.0.0
 * @title MessageType
 * @description
 * @create 2023/12/31 17:02
 **/
public enum MessageType {
	/**
	 * 创建.
	 */
	CREATE,
	/**
	 * 修改.
	 */
	UPDATE,
	/**
	 * 删除.
	 */
	DELETE,

	/**
	 * 交互成功.
	 */
	INTERACTION_SUCCESS,

	/**
	 * 交互创建.
	 */
	INTERACTION_CREATE,

	/**
	 * 交互IFRAME创建.
	 */
	INTERACTION_IFRAME_MODAL_CREATE,

	/**
	 * 交互MODAL创建.
	 */
	INTERACTION_MODAL_CREATE;

	public static MessageType of(String type) {
		switch (type) {
			case "MESSAGE_CREATE":
				return CREATE;
			case "MESSAGE_UPDATE":
				return UPDATE;
			case "MESSAGE_DELETE":
				return DELETE;
			case "INTERACTION_SUCCESS":
				return INTERACTION_SUCCESS;
			case "INTERACTION_CREATE":
				return INTERACTION_CREATE;
			case "INTERACTION_IFRAME_MODAL_CREATE":
				return INTERACTION_IFRAME_MODAL_CREATE;
			case "INTERACTION_MODAL_CREATE":
				return INTERACTION_MODAL_CREATE;
			default:
				return null;
		}
	}
}
